﻿<!--
 * Copyright (c) 2010, Andriy Syrov
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification, are permitted provided 
 * that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of conditions and the 
 * following disclaimer.
 * 
 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and 
 * the following disclaimer in the documentation and/or other materials provided with the distribution.
 *
 * Neither the name of Andriy Syrov nor the names of his contributors may be used to endorse or promote 
 * products derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 
 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 
 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 *   
 -->

<Window
    x:Class="WpfTimelineExExample.EditEventWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:me="clr-namespace:TimelineEx;assembly=TimelineExLib"
    xmlns:timeline="clr-namespace:TimelineLibrary;assembly=TimelineLibrary"
    Title="EditEventWindow"
    Height="490"
    Width="514">
    
    <Grid
        x:Name="LayoutRoot"
        Margin="2">

        <Grid.Resources>

            <me:BoolToVisibilityConverter
                x:Key="BoolToVisibilityConverter" />

        </Grid.Resources>

        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition
                Height="Auto" />
        </Grid.RowDefinitions>

        <Grid
            Grid.Row="1"
            VerticalAlignment="Center"
            HorizontalAlignment="Stretch">

            <Grid.ColumnDefinitions>
                <ColumnDefinition
                    Width="*"></ColumnDefinition>
                <ColumnDefinition
                    Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>

            <StackPanel
                Grid.Column="1"
                Orientation="Horizontal">
                <Button
                    x:Name="SaveButton"
                    Content="Save"
                    Click="SaveClick"
                    Width="75"
                    Height="23"
                    Margin="5"
                    HorizontalAlignment="Right"
                    Grid.Row="1" />

                <Button
                    x:Name="DeleteButton"
                    Content="Delete"
                    Click="DeleteClick"
                    Width="75"
                    Height="23"
                    Margin="5"
                    HorizontalAlignment="Right"
                    Grid.Row="1" />

                <Button
                    x:Name="CancelButton"
                    Content="Cancel"
                    Click="CancelClick"
                    Width="75"
                    Height="23"
                    Margin="5"
                    HorizontalAlignment="Right"
                    Grid.Row="1" />
            </StackPanel>
        </Grid>

        <TextBlock
            x:Name="lblTitle"
            HorizontalAlignment="Left"
            Height="18"
            Margin="0,16,0,0"
            TextWrapping="Wrap"
            VerticalAlignment="Top"
            Width="112"
            TextAlignment="Right"
            Text="Title:" />

        <TextBox
            x:Name="title"
            Height="24"
            Margin="116,12,17,0"
            TextWrapping="Wrap"
            Text="{Binding EditEvent.Title, Mode=TwoWay}"
            VerticalAlignment="Top" />

        <TextBlock
            x:Name="lblDescription"
            HorizontalAlignment="Left"
            Height="18"
            Margin="0,49,0,0"
            TextWrapping="Wrap"
            VerticalAlignment="Top"
            Width="112"
            TextAlignment="Right"
            Text="Description:" />

        <TextBox
            x:Name="description"
            Height="133"
            Margin="116,45,17,0"
            TextWrapping="Wrap"
            Text="{Binding EditEvent.Description, Mode=TwoWay}"
            VerticalAlignment="Top" />

        <CheckBox
            Content="Has Duration"
            Height="24"
            x:Name="hasDuration"
            Margin="116,184,17,0"
            VerticalAlignment="Top"
            IsChecked="{Binding EditEvent.IsDuration, Mode=TwoWay}" />

        <TextBlock
            x:Name="lblStartDate"
            HorizontalAlignment="Left"
            Height="18"
            Margin="0,214,0,0"
            TextWrapping="Wrap"
            VerticalAlignment="Top"
            Width="112"
            TextAlignment="Right"
            Text="Start Date Time:" />
        <TextBox
            Height="22"
            HorizontalAlignment="Left"
            Margin="116,209,0,0"
            Name="timePicker1"
            Text="{Binding EditEvent.StartDate, Mode=TwoWay}"
            VerticalAlignment="Top"
            Width="204" />

        <TextBlock
            x:Name="lblEndDate"
            HorizontalAlignment="Left"
            Margin="0,242,0,155"
            TextWrapping="Wrap"
            Width="112"
            Visibility="{Binding EditEvent.IsDuration, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
            TextAlignment="Right"
            Text="End Date Time:" />
        
        <TextBox
            Height="22"
            HorizontalAlignment="Left"
            Margin="116,237,0,0"
            Name="timePicker2"
            Text="{Binding EditEvent.EndDate, Mode=TwoWay}"
            Visibility="{Binding EditEvent.IsDuration, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
            VerticalAlignment="Top"
            Width="204" />

        <TextBlock
            x:Name="lblImage"
            HorizontalAlignment="Left"
            Height="18"
            Margin="0,0,0,124"
            TextWrapping="Wrap"
            VerticalAlignment="Bottom"
            Width="112"
            TextAlignment="Right"
            Text="Image:" />

        <TextBox
            x:Name="image"
            Height="24"
            Margin="116,0,17,122"
            TextWrapping="Wrap"
            Text="{Binding EditEvent.EventImage, Mode=TwoWay}"
            VerticalAlignment="Bottom" />

        <TextBlock
            x:Name="lblTeaserImage"
            HorizontalAlignment="Left"
            Height="18"
            Margin="0,0,0,85"
            TextWrapping="Wrap"
            VerticalAlignment="Bottom"
            Width="112"
            Text="Teaser Image"
            TextAlignment="Right" />

        <TextBox
            x:Name="teaserImage"
            Height="24"
            Margin="116,0,17,83"
            TextWrapping="Wrap"
            Text="{Binding EditEvent.TeaserEventImage, Mode=TwoWay}"
            VerticalAlignment="Bottom" />

        <TextBlock
            x:Name="lblVideo"
            HorizontalAlignment="Left"
            Height="18"
            Margin="0,0,0,46"
            TextWrapping="Wrap"
            VerticalAlignment="Bottom"
            Width="112"
            TextAlignment="Right"
            Text="Video:" />

        <TextBox
            x:Name="video"
            Height="24"
            Margin="116,0,17,44"
            TextWrapping="Wrap"
            Text="{Binding EditEvent.Video, Mode=TwoWay}"
            VerticalAlignment="Bottom" />
    </Grid>
</Window>
